package com.atguigu.realtime.sugar.mapper;

import com.atguigu.realtime.sugar.bean.Visitor;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author lzc
 * @Date 2022/3/29 14:00
 */
public interface VisitorMapper {
    
    @Select("SELECT\n" +
        "    toHour(stt) hour,\n" +
        "    sum(pv_ct) AS pv,\n" +
        "    sum(uv_ct) AS uv,\n" +
        "    sum(uj_ct) AS uj\n" +
        "FROM visitor_stats_2021\n" +
        "WHERE toYYYYMMDD(stt) = #{date}\n" +
        "GROUP BY toHour(stt)")
    List<Visitor> visitor(int date);
}
